home *** CD-ROM | disk | FTP | other *** search
- #ifdef WWW
- #include"capalloc.h"
- #include"capstdio.h"
- #include"msdostcp.h"
- #include<dos.h>
- #else
- #include <copyright.h>
- #include <wattcp.h>
- #include <dos.h>
- #endif /* WWW */
-
-
- word wathndlcbrk = 0; /* changes operation of the
- * break stuff if in resolve
- * or something
- */
- word watcbroke = 0; /* set to non-zero if wathndlcbrk happenned */
-
- /*
- * tcp_cbreak( mode )
- * - mode is composed of the following flags
- * 0x01 - disallow breakouts
- * 0x10 - display a message upon Cbreak
- *
- */
-
- static char *msgs[] = {
- "\nTerminating program\n",
- "\nCtrl-Breaks ignored\n" };
-
- static cbrkmode = 0;
- static int handler()
- {
- #ifndef WWW
- if ( wathndlcbrk ) {
- watcbroke = 1;
- if (cbrkmode & 0x10 ) outs("\nInterrupting\n");
- return( 1 );
- }
- if (cbrkmode & 0x10 )
- outs( msgs[ cbrkmode & 1 ]);
- if (cbrkmode & 1)
- return( 1 );
- tcp_shutdown();
- return( 0 );
- #else
- /*
- * No matter what, keep the application running.
- */
- if(wathndlcbrk)
- watcbroke = 1;
- return(1);
- #endif /* WWW */
- }
-
-
- tcp_cbrk( int mode )
- {
- cbrkmode = mode;
- ctrlbrk(handler);
- }
-